package com.tsd.common.service;

import cn.binarywang.wx.miniapp.config.WxMaConfig;
import com.tsd.common.entity.CommonShortUrl;
import com.tsd.common.entity.CommonShortUrlExt;
import com.tsd.core.vo.PageBean;
import com.tsd.system.entity.SysUser;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 描述：CommonShortUrl服务实现层接口
 *
 * @author Hillpool
 * @date 2022/12/07 11:35:18
 */
public interface CommonShortUrlService {

    /**
     * 描述：根据id获取CommonShortUrl
     *
     * @param id
     */
    CommonShortUrl getCommonShortUrlById(Long id) throws Exception;

    /**
     * 描述：根据sid获取CommonShortUrl
     *
     * @param sid
     */
    CommonShortUrlExt queryBySid(String sid) throws Exception;

    /**
     * 描述：根据sid列表删除CommonShortUrl
     *
     * @param list
     */
    void deleteCommonShortUrls(List<String> list, SysUser opUser) throws Exception;

    /**
     * 描述：保存或更新CommonShortUrl
     *
     * @param record
     * @param opUser
     */
    void saveCommonShortUrl(CommonShortUrlExt record, SysUser opUser) throws Exception;

    /**
     * 描述：根据params分页查询CommonShortUrl
     *
     * @param params
     * @param page
     */
    List<CommonShortUrlExt> findCommonShortUrls(Map<String, Object> params, PageBean page) throws Exception;

    /**
     * 描述：根据params分页查询CommonShortUrl
     *
     * @param params
     */
    List<CommonShortUrlExt> findCommonShortUrls(Map<String, Object> params) throws Exception;

    List<CommonShortUrlExt> queryByOwnerList(String bizType, List<String> ownerList);

    CommonShortUrlExt queryValidByCode(String code);

    String genDirectWxMiniUrl(String jumpWxaPath, String jumpWxaQuery, Date expireTime, WxMaConfig config);

    String genDirectWxMiniUrl(Map<String, Object> map, int days, CommonShortUrlExt urlExt);

    void genDirectWxMiniUrl(String jumpWxaPath, String jumpWxaQuery, String ownerSid, String bizType, WxMaConfig config, HttpServletRequest request);
}